<?php
declare (strict_types = 1);

namespace app\home\controller;

use app\adminapi\model\pyg_category;
use app\adminapi\model\pyg_goods;
use app\home\userBusiness\BaseController;
use app\home\userBusiness\goodsBusiness;
use think\facade\View;
use think\Request;

class Goods extends  BaseController
{
    /**
     * 商品列表
     * @return \think\response\View
     */
    public function list(){
        try {
            $data = goodsBusiness::getList();
            View::assign('list',$data['list']);
            View::assign('cateInfo',$data['cateInfo']);
            return \view();
        }catch (\Exception $exception){
           return \view('error/error');
        }

    }

    /**
     * 商品详情
     * @return \think\response\View
     */
    public function Item(){
        $id = \request()->get('id');
        $data = pyg_category::where('id',$id)->find()->toArray();
        View::assign('lmit',$data);
        return view();
    }

    /**
     * 购物车
     * @return \think\response\View
     */
    public function cart(){

        return view();
    }



}
